Skip to content

refactor(network): optimized client mem usage#1483

Merged
xiaost merged 1 commit intomainfrom
refactor/client-mem-usage
Mar 6, 2026
Merged

refactor(network): optimized client mem usage#1483
xiaost merged 1 commit intomainfrom
refactor/client-mem-usage

Conversation

@xiaost
Copy link
Contributor

@xiaost xiaost commented Mar 3, 2026

Use Read() instead of Peek()+Skip() in ReadByte() and appendBodyFixedSize()
to avoid holding references to the underlying buffer. Peek() returns slices
that reference the internal buffer, preventing it from being released or
reused until the reference is dropped.

Also updated cloudwego/gopkg dependency and moved connstate import to
gopkg/net/connstate.

@xiaost xiaost requested review from a team as code owners March 3, 2026 07:28
@codecov
Copy link

codecov bot commented Mar 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.25%. Comparing base (bf7ec5b) to head (52be57c).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1483      +/-   ##
==========================================
+ Coverage   86.22%   86.25%   +0.02%     
==========================================
  Files         148      148              
  Lines       14157    14158       +1     
==========================================
+ Hits        12207    12212       +5     
+ Misses       1417     1416       -1     
+ Partials      533      530       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@xiaost xiaost force-pushed the refactor/client-mem-usage branch 3 times, most recently from a72dca0 to 93a1e5e Compare March 5, 2026 07:53
Use Read() instead of Peek()+Skip() in ReadByte() and appendBodyFixedSize()
to avoid holding references to the underlying buffer. Peek() returns slices
that reference the internal buffer, preventing it from being released or
reused until the reference is dropped.

Also updated cloudwego/gopkg dependency and moved connstate import to
gopkg/net/connstate.
@xiaost xiaost force-pushed the refactor/client-mem-usage branch from 93a1e5e to 52be57c Compare March 5, 2026 08:01
@xiaost xiaost merged commit 73d7261 into main Mar 6, 2026
32 checks passed
@xiaost xiaost deleted the refactor/client-mem-usage branch March 6, 2026 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants